<template>
  <BorderBox
    title="虚拟机"
    :headerBottom="false"
    :wrapperStyle="{
      width: 'calc((100% - 32px) / 3)',
      height: '170px',
    }"
    :styleText="{ height: '75%' }"
  >
    <template #main_info>
      <div class="flex" style="height: 100%">
        <div class="main_info_l flex_center">
          <p>22</p>
          <p class="used">总数</p>
        </div>
        <div class="main_info_r">
          <Charts id="vmId" :options="pieOption" width="100%" height="100%" />
        </div>
      </div>
    </template>
  </BorderBox>
</template>

<script setup>
import { ref } from "vue";
import Charts from "@/components/Charts/index.vue";
import { pieEcharts } from "@/hooks/echarts-config.js";
defineProps({
  title: {
    type: String,
    default: "",
  },
});
const chartsData = ref([
  { name: "aaa", value: 820 },
  { name: "bbb", value: 320 },
  { name: "eee", value: 820 },
  { name: "ccc", value: 820 },
  { name: "ddd", value: 333 },
]);
const pieOption = ref(pieEcharts(chartsData.value));
</script>

<style lang="scss" scoped>
.main_info_l {
  font-size: 18px;
  min-width: 100px;
  flex-direction: column;
  align-items: center;
  .used {
    font-size: 12px;
    color: #2c406899;
    padding-top: 6px;
  }
}
.main_info_r {
  width: 100%;
  // border: 1px solid #000;
}
</style>
